<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ taglib prefix="product" tagdir="/WEB-INF/tags/product"%>
<%@ taglib prefix="system" tagdir="/WEB-INF/tags/system"%>
<%@ taglib prefix="order" tagdir="/WEB-INF/tags/order"%>
<div class="order_show" id="returnPanel" name="shipmentPanel">
	<input type="hidden" id="salesOrderId" name="salesOrderId"	value="${order.salesOrderId}" />
	
	<table border="0" cellspacing="0" cellpadding="0" width="100%">
		<tr>
			<td style="vertical-align: top; width: 35%">
				<table border="0" cellspacing="0" cellpadding="0"
					class="consignee_table" width="100%">
					<tr>
						<th>
							<fmt:message key="salesOrder.orderNo" />
						</th>
						<td>
							${order.orderNo}
						</td>
					</tr>
					<tr>
						<th>
							<fmt:message key="salesOrder.createTime" />
						</th>
						<td>
							<common:datetimeFormat date="${order.createTime}" />
						</td>
					</tr>
					<c:choose>
						<c:when test="${!order.orderAddress.isVirtual}">
							<tr>
								<th>
									<fmt:message key="salesOrder.returnPanel.orderAddress" />(<span class="red">*</span>)
								</th>
								<td>
									<c:set var="regionId" value="${order.orderAddress.regionId}" scope="request"/>
									<c:set var="regionFullName" value="${order.orderAddress.regionFullName}" scope="request"/>
									
									<div id="regionShowDiv">
										<%--地区显示区域 --%>
										<%@include file="include/orderPanel4RegionShow.jsp" %>
									</div>
									<div id="regionModifyDiv">
										<%--地区修改区域 --%>
									</div>
									<br/>
									<input type="text" id="address1" name="address1"	value="${order.orderAddress.address1}" style="width:240px" class="inputtxt" />
								</td>
							</tr>
							<tr>
								<th>
									<fmt:message key="orderShipment.deliveryTypeDesc" />(<span class="red">*</span>)
								</th>
								<td id="shipPaneldeliveryTypeDiv">
									<%--配送方式选择区域 --%>
									<%@include file="include/orderShipReturnPanel4DeliveryTypeDesc.jsp" %>
								</td>
							</tr>
							<tr>
								<th>
									<fmt:message key="orderShipment.shippingCost" />(<span class="red">*</span>)
								</th>
								<td>
									<input type="text" id="shippingCost" name="shippingCost"	value="${order.shippingCost}" style="width:150px" class="inputtxt" />
									<probiz:plugin_tip id="memo_tip"><fmt:message key="salesOrder.panel.shippingCost.tip" /></probiz:plugin_tip>
								</td>
							</tr>
							<tr>
								<th>
									<fmt:message key="salesOrder.returnPanel.firstname" />(<span class="red">*</span>)
								</th>
								<td>
									<input type="text" id="firstname" name="firstname"	value="${order.orderAddress.firstname}" style="width:150px" class="inputtxt" />
								</td>
							</tr>
							<tr>
								<th>
									<fmt:message key="orderAddress.phoneNumber" />(<span class="red">*</span>)
								</th>
								<td>
									<input type="text" id="phoneNumber" name="phoneNumber"	value="${order.orderAddress.phoneNumber}" style="width:150px" class="inputtxt" />
								</td>
							</tr>
							<tr>
								<th>
									<fmt:message key="orderAddress.email" />
								</th>
								<td>
									<input type="text" id="email" name="email"	value="${order.orderAddress.email}" style="width:150px" class="inputtxt" />
								</td>
							</tr>
							<tr>
								<th>
									<fmt:message key="orderAddress.postalcode" />
								</th>
								<td>
									<input type="text" id="postalcode" name="postalcode"	value="${order.orderAddress.postalcode}" style="width:150px" class="inputtxt" />
								</td>
							</tr>
						</c:when>
						<c:otherwise>
							<tr>
								<th>
									<fmt:message key="orderAddress.email" />
								</th>
								<td>
									<input type="text" id="email" name="email"	value="${order.orderAddress.email}" style="width:150px" class="inputtxt" />
									<input type="hidden" id="isVirtualAddress" value=""/><!-- 用于标识是否虚拟地址 -->
								</td>
							</tr>
						</c:otherwise>
					</c:choose>	
					<tr>
						<th>
							<fmt:message key="orderShipment.trackingNo" />
						</th>
						<td>
							<input type="text" id="trackingNo" name="trackingNo"	value="" style="width:150px" class="inputtxt" validConf="maxlength=15" maxlength="15"/>
						</td>
					</tr>
					<tr>
						<th>
							<fmt:message key="orderShipment.returnReason" />(<span class="red">*</span>)
						</th>
						<td>
							<span>
							<select name="returnReasonPre" validConf="required" class="selecttxt">
								<option value=""><fmt:message key="salesOrder.panel.pleaseSelect"/></option>
								<c:forEach begin="0" end="3" varStatus="varStatus">
									<option value="<fmt:message key="orderShipment.returnReason.${varStatus.index+1}" />"><fmt:message key="orderShipment.returnReason.${varStatus.index+1}" /></option>
								</c:forEach>
							</select>
							</span>
							<br/>
							<textarea id="returnReason" name="returnReason" style="height:40px;width:240px;margin-top:5px;" class="textareatxt" ></textarea>
							
						</td>
					</tr>
					<tr>
						<th>
							<fmt:message key="orderShipment.memo"/>
						</th>
						<td>
							<textarea id="memo" name="memo" style="height:140px;width:240px" class="textareatxt" ></textarea>
						</td>
					</tr>
				</table>
			</td>
			<td style="vertical-align: top;">
				<%@include file="include/orderReturnPanel4Product.jspf" %>

				<%@include file="include/orderReturnPanel4Gift.jspf" %>

				<%@include file="include/orderReturnPanel4Gc.jspf" %>
			</td>
		</tr>
	</table>
</div>
<v:javascript formName="orderShipment" staticJavascript="false" />
<c:choose>
	<c:when test="${!order.orderAddress.isVirtual}">
		<v:javascript formName="orderAddress" staticJavascript="false" />
	</c:when>
	<c:otherwise>
		<v:javascript formName="virtualOrderAddress" staticJavascript="false" />
	</c:otherwise>
</c:choose>	
<script type="text/javascript">
$j(document).ready(function () {
	autoApplyValidate($('returnPanel'));
});	

</script>
